<?php

class Share_Model_Share extends YouNet_Db_Table_Row 
{
    public  $_default_image ;
    function getShareUrlByCampaign($id_page,$id_campaign){
        $view	= new YouNet_View_Helper_SocialUrl ();
        $share_url = $view->socialUrl("/share/index/share/id_page/" . $this->is_page . "/id_campaign/" . $id_campaign);
        return $share_url ;
   }
   function saveCampaign($arr_share)
   {
       $this->title = $arr_share["title"];
       $this->description = $arr_share["description"];
       $this->id_campaign = $arr_share["id_campaign"];
              
       if($arr_share["image"])
       {
          $this->image = $arr_share["image"]; 
       }
       
       $this->save();
   }
   function setDefaultImage($image)
   {
       $this->_default_image = $image ;
   }
   function getDefaultImage()
   {
       return $this->_default_image;
   }
   function getImageShareUrl()
   {
       return STATIC_URL."/media/style/image/".$this->image ;
   }
}

